/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.sfo.viewer.graphics;


import designersfo.Cons.CellInfo.CellFormat;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;


/**
 *
 * @author renke002
 */
public class QuestionNumber extends ContentLayout
{

    /**
     *
     */
    private final static float QUESTION_SIZE_BACKGROUND = (float) 0.202;
    /**
     *
     */
    private Ellipse2D.Double background;
    private String numberLabel;


    /**
     *
     * @param container
     * @param cellFormat
     */
    public QuestionNumber( Rectangle container , CellFormat cellFormat )
    {
        this.numberLabel = "#";

        int circleSize = 16;

        Point2D anchor = ContentLayout.placeContent(
                container ,
                new Dimension( circleSize , circleSize ) ,
                cellFormat );

        this.background = new Ellipse2D.Double(
                anchor.getX() ,
                anchor.getY() ,
                circleSize ,
                circleSize );
    }


    /**
     * Draw this question number onto the canvas.
     * <p/>
     * @param g2d The java.awt.Graphics2D canvas do draw onto.
     */
    @Override
    public void draw( Graphics2D g2d )
    {
        if ( this.background != null )
        {
            g2d.setColor( Color.BLACK );
            g2d.fill( background );
//            g2d.draw( background );
        }
    }


    /**
     *
     * @return
     */
    @Override
    public String getLabel()
    {
        return this.numberLabel;
    }

}
